function XSLTransformer (FOCS) {   
    var MODE = FOCS;
    		    		
	this.calculate = (MODE)?(
		function(target,xmlparameter,xslparameter,callback) {
			var processor = new XSLTProcessor();
			var resultDoc,resultString;
            if ($.isFunction(processor.transformDocument)) {
                // Mozilla interface
                resultDoc = document.implementation.createDocument("", "", null);
                processor.transformDocument(xmlparameter.responseXML, xslparameter.responseXML, resultDoc, null);
                resultString = new XMLSerializer().serializeToString(resultDoc);
                target.html(resultString);
                
            }
            else {
                processor.importStylesheet(xslparameter.responseXML);
                resultDoc = processor.transformToFragment(xmlparameter.responseXML, document);
                target.empty().append(resultDoc);
                resultString = target.html();
            }
            var state = {
            	resultDoc:resultString,
            	xmlDoc:xmlparameter.responseXML,
            	xslDoc:xslparameter.responseXML
            }
			callback(state);
			
		}):(
		function(target,xmlparameter,xslparameter,callback) {
			var interval = setInterval(function() {
            	var out;
            	try {
                	out = xmlparameter.transformNode(xslparameter.XMLDocument);
                	clearInterval(interval);
					target.html(out);
					
					var state = {
						resultDoc:target.html(),
						xmlDoc:xmlparameter.XMLDocument,
						xslDoc:xslparameter.XMLDocument
				    }
					callback(state);
					
            	} catch (e) {
            		error(e.name + ":" + e.message + " >>> Element:"+target.attr("id"));
            		debug("Trying to reload sources... >>> Element:"+target.attr("id"));
            	}	
        	},10);
		});
}